﻿<UserControl x:Class="Giraffe.Client.ConversationModule.ConversationControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Constants="clr-namespace:Giraffe.Client.Common.Constants;assembly=Giraffe.Client.Common"
    xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:cal="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation" xmlns:Common="clr-namespace:Giraffe.Client.Common;assembly=Giraffe.Client.Common">
    <!--<Grid>
        <Grid.Resources>
            <DataTemplate x:Key="EventTemplate" DataType="{x:Type System:String}">
                <Border CornerRadius="5" BorderThickness="1" BorderBrush="Gray" Margin="2">
                    <Border.Background>
                        <SolidColorBrush Color="#88DDDDEE"/>
                    </Border.Background>
                    <Grid MinHeight="40">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Fill="Yellow" Width="20" Height="20" Margin="6" VerticalAlignment="Center"/>
                        <TextBlock Grid.Column="1" Text="{Binding}" Margin="3" VerticalAlignment="Center" TextWrapping="Wrap" ScrollViewer.CanContentScroll="False"/>
                        <CheckBox x:Name="CheckClear" Grid.Column="2" VerticalAlignment="Center" Margin="6"/>
                    </Grid>
                </Border>
            </DataTemplate>
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Slider x:Name="HorizontalAdjust" Grid.Column="1" Width="400" Maximum="400" Value="200"/>
        <Slider x:Name="VerticalAdjust" Grid.Row="1" Orientation="Vertical" IsDirectionReversed="True" Height="400" Maximum="400" Value="200"/>
        <ListBox x:Name="list" Grid.Row="1" Grid.Column="1" HorizontalContentAlignment="Stretch" 
                 Width="{Binding ElementName=HorizontalAdjust, Path=Value}" Height="{Binding ElementName=VerticalAdjust, Path=Value}"  
                 HorizontalAlignment="Left" VerticalAlignment="Top" ItemTemplate="{DynamicResource EventTemplate}" 
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled">
            <System:String>A really, really long value: Value1</System:String>
            <System:String>Value2</System:String>
            <System:String>Value3</System:String>
            <System:String>Value4</System:String>
            <System:String>ABCDEFGHIJKLMNOPQRSTUVWXYZ:Value5</System:String>
        </ListBox>
    </Grid>-->

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="4*" />
            <RowDefinition Height="Auto" MinHeight="20"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <Border Grid.RowSpan="3" x:Name="backGrounBorder"/>

        <ContentControl Grid.Row="0" 
                        cal:RegionManager.RegionName="{x:Static Constants:RegionNames.ConverstionHistoryPanel}" 
                        cal:RegionManager.RegionContext="{Binding}"
                        />
        
        <GridSplitter Grid.Row="1" 
                      Height="5"
                      VerticalAlignment="Top"
                      HorizontalAlignment="Stretch"
                      ResizeDirection="Rows"
                      ResizeBehavior="PreviousAndNext"
                      Panel.ZIndex="2"
                      Background="Transparent"/>

        <Border Grid.Row="1" Background="LightGray">
            <ContentControl cal:RegionManager.RegionName="{x:Static Constants:RegionNames.ConversationToolsPanel}" 
                        cal:RegionManager.RegionContext="{Binding}"
                        MinHeight="20"/>
        </Border>


        <ContentControl Grid.Row="2"  
                        cal:RegionManager.RegionName="{x:Static Constants:RegionNames.ConversationAnswerPanel}" 
                        cal:RegionManager.RegionContext="{Binding}"/>


    </Grid>
</UserControl>
